package com.bw.controller;

import com.bw.bean.SugarDTO;
import com.bw.service.SugarService;
import com.sugar.SugarUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.Year;
import java.util.List;
import java.util.Map;

@RestController
public class SugarController {
    @Autowired
    SugarService sugarService;

    @RequestMapping("/list1")
    public Map getList1(){
        List<SugarDTO> list1 = sugarService.getList1();
        return SugarUtil.getMapData(list1);
    }

    @RequestMapping("/list2")
    public Map getList2(){
        List<SugarDTO> list2 = sugarService.getList2();
        return SugarUtil.getMapData(list2);
    }

    @RequestMapping("/list3")
    public Map getList3(){
        List<SugarDTO> list3 = sugarService.getList3();
        return SugarUtil.getMapData(list3);
    }

    @RequestMapping("/list4")
    public Map getList4(){
        List<SugarDTO> list4 = sugarService.getList4();
        return SugarUtil.getMapData(list4);
    }

    @RequestMapping("/list5")
    public Map getList5(){
        List<SugarDTO> list5 = sugarService.getList5();
        return SugarUtil.getMapData(list5);
    }

}
